#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

void right_move(char* arr, int i)
{
	int len = strlen(arr);
	int n = 0; char ret = 0;
	for (n = 0; n < i; n++)
	{
		ret = arr[len - 1];
		int j = 0;
		for (j = len - 1; j > 0; j--)
		{
			arr[j] = arr[j - 1];
		}
		arr[0] = ret;
	}
}
int main()
{
	char arr[100] = { 0 };
	int i = 0;
	scanf("%d", &i);
	scanf("%s", arr);
	right_move(arr, i);
	printf("%s", arr);

	return 0;
}